package ysq.xyg.service.impl;

import com.github.pagehelper.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import ysq.xyg.dao.RelayDao;
import ysq.xyg.model.BaseDepart;
import ysq.xyg.model.Relay;
import ysq.xyg.service.RelayService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yu sheng qiang
 * @create 2017-04-19 14:11
 **/
@Service("relayService")
public class RelayServiceImpl extends BaseServiceImpl<Relay> implements RelayService {
    @Resource
    private RelayDao relayDao;
    @Autowired
    public void setRelayDao(RelayDao relayDao) {
        this.baseDao = relayDao;
    }
    //条件查询
    public List<Relay> list(Relay relay) {
        Example example = new Example(Relay.class);
        Example.Criteria criteria = example.createCriteria();
        if(relay!=null){
            if(StringUtil.isNotEmpty(relay.getRelayId())){
                criteria.andEqualTo("relayId",relay.getRelayId());
            }
        }
        List<Relay> list=relayDao.selectByExample(example);
        return list;
    }

}
